package com.flyco.dialog.widget;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.flyco.dialog.listener.OnBtnClickL;
import com.flyco.dialog.utils.CornerUtils;
import com.flyco.dialog.widget.base.BaseDialog;

@SuppressLint({"RtlHardcoded"})
public class MaterialTipDialog extends BaseDialog
{
  private int bgColor = Color.parseColor("#ffffff");
  private int btnColorPress = Color.parseColor("#E3E3E3");
  private String btnText = "确定";
  private int btnTextColor = Color.parseColor("#468ED0");
  private float btnTextSize_SP = 15.0F;
  private String content;
  private int contentGravity = 16;
  private int contentTextColor = Color.parseColor("#8a000000");
  private float contentTextSize_SP = 16.0F;
  private float cornerRadius_DP = 3.0F;
  private boolean isTitleShow = true;
  private LinearLayout ll_btns;
  private LinearLayout ll_container;
  private OnBtnClickL onBtnClickL;
  private String title = "温馨提示";
  private int titleTextColor = Color.parseColor("#DE000000");
  private float titleTextSize_SP = 22.0F;
  private TextView tv_btn;
  private TextView tv_content;
  private TextView tv_title;

  public MaterialTipDialog(Context paramContext)
  {
    super(paramContext);
  }

  public MaterialTipDialog bgColor(int paramInt)
  {
    this.bgColor = paramInt;
    return this;
  }

  public MaterialTipDialog btnColorPress(int paramInt)
  {
    this.btnColorPress = paramInt;
    return this;
  }

  public MaterialTipDialog btnText(String paramString)
  {
    this.btnText = paramString;
    return this;
  }

  public MaterialTipDialog btnTextColor(int paramInt)
  {
    this.btnTextColor = paramInt;
    return this;
  }

  public MaterialTipDialog btnTextSize(float paramFloat)
  {
    this.btnTextSize_SP = paramFloat;
    return this;
  }

  public MaterialTipDialog content(String paramString)
  {
    this.content = paramString;
    return this;
  }

  public MaterialTipDialog contentGravity(int paramInt)
  {
    this.contentGravity = paramInt;
    return this;
  }

  public MaterialTipDialog contentTextColor(int paramInt)
  {
    this.contentTextColor = paramInt;
    return this;
  }

  public MaterialTipDialog contentTextSize(float paramFloat)
  {
    this.contentTextSize_SP = paramFloat;
    return this;
  }

  public MaterialTipDialog cornerRadius(float paramFloat)
  {
    this.cornerRadius_DP = paramFloat;
    return this;
  }

  public MaterialTipDialog isTitleShow(boolean paramBoolean)
  {
    this.isTitleShow = paramBoolean;
    return this;
  }

  public View onCreateView()
  {
    widthScale(0.88F);
    this.ll_container = new LinearLayout(this.context);
    this.ll_container.setOrientation(1);
    this.tv_title = new TextView(this.context);
    this.tv_title.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
    this.ll_container.addView(this.tv_title);
    this.tv_content = new TextView(this.context);
    this.tv_content.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
    this.ll_container.addView(this.tv_content);
    this.ll_btns = new LinearLayout(this.context);
    this.ll_btns.setOrientation(0);
    this.ll_btns.setGravity(5);
    this.tv_btn = new TextView(this.context);
    this.tv_btn.setGravity(17);
    this.tv_btn.setPadding(dp2px(15.0F), dp2px(10.0F), dp2px(15.0F), dp2px(10.0F));
    this.ll_btns.addView(this.tv_btn);
    this.ll_container.addView(this.ll_btns);
    return this.ll_container;
  }

  public void setOnBtnClickL(OnBtnClickL paramOnBtnClickL)
  {
    this.onBtnClickL = paramOnBtnClickL;
  }

  public boolean setUiBeforShow()
  {
    float f = dp2px(this.cornerRadius_DP);
    this.tv_title.setGravity(16);
    this.tv_title.setPadding(dp2px(20.0F), dp2px(20.0F), dp2px(20.0F), dp2px(0.0F));
    TextView localTextView1 = this.tv_title;
    int i;
    String str;
    label88: LinearLayout localLinearLayout;
    int j;
    int k;
    int m;
    if (this.isTitleShow)
    {
      i = 0;
      localTextView1.setVisibility(i);
      TextView localTextView2 = this.tv_title;
      if (!TextUtils.isEmpty(this.title))
        break label353;
      str = "温馨提示";
      localTextView2.setText(str);
      this.tv_title.setTextColor(this.titleTextColor);
      this.tv_title.setTextSize(2, this.titleTextSize_SP);
      this.tv_content.setPadding(dp2px(20.0F), dp2px(20.0F), dp2px(20.0F), dp2px(20.0F));
      this.tv_content.setGravity(this.contentGravity);
      this.tv_content.setText(this.content);
      this.tv_content.setTextColor(this.contentTextColor);
      this.tv_content.setTextSize(2, this.contentTextSize_SP);
      this.tv_content.setLineSpacing(0.0F, 1.3F);
      localLinearLayout = this.ll_btns;
      j = dp2px(20.0F);
      k = dp2px(0.0F);
      m = dp2px(10.0F);
      if (!this.isTitleShow)
        break label362;
    }
    label353: label362: for (int n = dp2px(10.0F); ; n = dp2px(0.0F))
    {
      localLinearLayout.setPadding(j, k, m, n);
      this.tv_btn.setText(this.btnText);
      this.tv_btn.setTextColor(this.btnTextColor);
      this.tv_btn.setTextSize(2, this.btnTextSize_SP);
      this.ll_container.setBackgroundDrawable(CornerUtils.cornerDrawable(this.bgColor, f));
      this.tv_btn.setBackgroundDrawable(CornerUtils.listItemSelector(0.0F, this.bgColor, this.btnColorPress, true));
      this.tv_btn.setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          if (MaterialTipDialog.this.onBtnClickL != null)
          {
            MaterialTipDialog.this.onBtnClickL.onBtnClick();
            return;
          }
          MaterialTipDialog.this.dismiss();
        }
      });
      return false;
      i = 8;
      break;
      str = this.title;
      break label88;
    }
  }

  public MaterialTipDialog title(String paramString)
  {
    this.title = paramString;
    return this;
  }

  public MaterialTipDialog titleTextColor(int paramInt)
  {
    this.titleTextColor = paramInt;
    return this;
  }

  public MaterialTipDialog titleTextSize(float paramFloat)
  {
    this.titleTextSize_SP = paramFloat;
    return this;
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.flyco.dialog.widget.MaterialTipDialog
 * JD-Core Version:    0.6.2
 */